package com.br3akr.rollerServer.testCases;


/**
 * @author Sean Smith
 *
 */
public class TestRoom {
/*
	private boolean updateHappened = false;
	
	@Test
	public void test() {
		try {
			Room room = new Room();
			room.addObserver(this);
			
			try {
				String msg = "Test message";
				room.setMessage(msg);
				if (!updateHappened) {
					fail("Update did not occur - set room message.");
				}
				if (!room.getMessage().equals(msg)) {
					fail("Message should be " + msg + " instead is " + room.getMessage());
				}
				updateHappened = false;
			} catch (Exception e) {
				fail("Set message failed: " + e.getMessage());
			}
			
			try {
				String msg = "Second message for testing";
				room.setMessage(msg);
				if (!updateHappened) {
					fail("Update did not occur - reset room message.");
				}
				if (!room.getMessage().equals(msg)) {
					fail("Message should be " + msg + " instead is " + room.getMessage());
				}
				updateHappened = false;
			} catch (Exception e) {
				fail("Set message failed: " + e.getMessage());
			}
			
			try {
				room.setMessage(null);
				if (!updateHappened) {
					fail("Update did not occur - set room message to null.");
				}
				if (room.getMessage() != null) {
					fail("Message should be null instead is " + room.getMessage());
				}
				updateHappened = false;
			} catch (Exception e) {
				fail("Set message failed: " + e.getMessage());
			}
			
			room.updateAll();
			if (!updateHappened) {
				fail("Update did not occur - set room message to null.");
				updateHappened = false;
			}
			
			Session sA = new Session("PlayerA", false);
			Session sB = new Session("PlayerB", false);
			Session sC = new Session("PlayerC", true);
			
			try {
				room.addSession(sA);
			} catch (Exception e) {
				fail("Add session 'A' failed.");
			}
			
			try {
				room.addSession(sB);
			} catch (Exception e) {
				fail("Add session 'B' failed.");
			}
			
			try {
				room.addSession(sC);
			} catch (Exception e) {
				fail("Add session 'C' failed.");
			}
			
			boolean hasA = false;
			boolean hasB = false;
			boolean hasC = false;
			
			for (Session cur : room.getSessions()) {
				hasA = hasA || cur.equals(sA);
				hasB = hasB || cur.equals(sB);
				hasC = hasC || cur.equals(sC);
			}
			
			if (!hasA) fail("PlayerA has not been added.");
			if (!hasB) fail("PlayerB has not been added.");
			if (!hasC) fail("PlayerC has not been added.");
			
			Set<Session> sessions = new HashSet<Session>();
			sessions.addAll(room.getSessions());
			
			for (Session cur : sessions) {
				room.removePlayer(cur.getPlayer());
			}
			
			hasA = false;
			hasB = false;
			hasC = false;
			
			for (Session cur : room.getSessions()) {
				hasA = hasA || cur.equals(sA);
				hasB = hasB || cur.equals(sB);
				hasC = hasC || cur.equals(sC);
			}
			
			if (hasA) fail("PlayerA has not been removed.");
			if (hasB) fail("PlayerB has not been removed.");
			if (hasC) fail("PlayerC has not been removed.");
			
		} catch (Exception e) {
			e.printStackTrace();
			fail("Room constructor failed. " + e.getMessage());
		}
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		if (!(arg0 instanceof Room)) {
			fail("Supplied argument for update is not an instance of Room.");
		}
		
		if (arg1 != null) {
			fail("arg1 in update is expected to be null.");
		}
		
		updateHappened = true;
	}
	*/
}
